<template>
  <div class="user">
    <div class="user-header">
      <div class="user-detail">
        <img class="user-img" src="@/assets/系统头像.png" />
        <div class="detail">
          <el-row class="title">
            <el-col :span="2"><p>一个大喇叭</p></el-col>
            <el-col :span="5" class="edit-btn"><el-button size="small"><img class="edit-img" src="@/assets/编辑.png" />编辑资料</el-button></el-col>
          </el-row>
          <el-row class="detail-bottom">
            <p class="address">云链钱包地址：<span>+ XXXXXXXX</span></p>
            <el-col :span="4" class="num"><p>拥有藏品总数：<span>569</span></p></el-col>
            <el-col :span="4" class="total"><p>总成交价：<span>￥569</span></p></el-col>
          </el-row>
        </div>
        <div class="right">
          <el-row class="detail-right"  type="flex">
            <el-col :span="2" :offset="16">
              <img src="@/assets/兑换.png" />
              <p>购买</p>
            </el-col>
            <el-col :span="2">
              <img src="@/assets/支付设置.png" />
              <p>支付设置</p>
            </el-col>
            <el-col :span="2">
              <img src="@/assets/记录.png" />
              <p>记录</p>
            </el-col>
          </el-row>
        </div>
      </div>
    </div>
    <!-- 藏品导航栏区域开始 -->
    <div class="nav">
      <div class="content">
        <el-menu
          :default-active="this.$route.path"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          background-color="#F8FBFF"
          text-color="#000"
          active-text-color="#2C2C34"
          router
        >
        <el-menu-item
          :key="key"
          v-for="(item,key) in navItems"
          :index="item.index"
          :route="item.key"
          :class="{ active: key == IsIndex }"
          @click="change(key)"
        >{{item.name}}</el-menu-item>
          <!-- <el-menu-item index="/owned">我拥有的</el-menu-item>
          <el-menu-item index="/sold">我卖出的</el-menu-item>
          <el-menu-item index="/molten">我铸造的</el-menu-item>
          <el-menu-item index="/records">交易记录</el-menu-item> -->
        </el-menu>
      </div>
    </div>
    <!-- 藏品导航栏区域结束 -->
    <!-- 藏品区域 -->
    <el-main>
      <!-- 设置子路由出口 -->
      <router-view></router-view>
    </el-main>
    <!-- 底部区域 -->
    <layout-footer></layout-footer>
  </div>
</template>

<script>
import LayoutFooter from '@/components/LayoutFooter.vue'

export default {
  name: 'user',
  components: {
    LayoutFooter
  },
  data () {
    return {
      // 切换颜色标识
      IsIndex: 0,
      navItems: [
        { name: '我拥有的', index: '/owned' },
        { name: '我卖出的', index: '/sold' },
        { name: '我铸造的', index: '/molten' },
        { name: '交易记录', index: '/records' }
      ]
    }
  },
  methods: {
    change (key) {
      this.IsIndex = key
    }
  }
}
</script>
<style lang="scss" scoped>
.user {
  width: 100%;
  background: #F8FBFF;
  margin-top: 68px;

  .user-header {
    height: 138px;
    background: #2C2C34;
    padding-top: 48px;
    padding-left: 88px;

    img {
      width: 82px;
      height: 82px;
    }
    .user-detail {
      color: #fff;

      .detail {
        margin-top: -100px;
        margin-left: 110px;

        .title {

          p{
            width: 90px;
            font-weight: bold;
            font-size: 18px;
          }
          .el-button {
            width: 104px;
            height: 33px;
            background: #3B3B42;
            color: #fff;
            border-radius: 500px;
            border: none;
            font-size: 14px;
          }

          .edit-btn {
            margin-top: 14px !important;
          }

          .edit-img {
            width: 13.44px;
            height: 13.02px;
            padding-right: 4px;
            // margin-top: -200px;
            // margin-left: 110px;
          }
        }
        .detail-bottom {
          margin-top: -10px;
          font-size: 16px;
          line-height: 0;
          font-weight: 400;

          .num {
            width: 180px;
            margin-top: -8px;
          }

          .total {
            margin-top: -8px;
          }

          span {
            color: #0066ED;
          }
        }
      }

      .right {
      }
      .detail-right {
        margin-top: -68px;
        text-align: center;

        img {
          width: 21.31px;
          height: 20.02px;
        }
        p {
          line-height: 0;
          margin-top: 7px;
          font-size: 14px;
        }
      }
    }
  }

  .nav {
    width: 100%;
    height: 57px;

    .content{
      height: 57px;
      margin-left: 74px;

      ul {
        border: 0;

        li {
          border: 0;
        }
      }
      .el-menu {
        .el-menu-item {
          width: 167px;
          height: 57px;
          background-color: rgba(0,0,0,0.1);
          text-align: center;
        }
        .el-menu-item .is-active{
          border-bottom-color: none;
        }

        .el-menu-item:not(.is-disabled):hover {
          background-color: #F8FBFF !important;
          color: #000 !important;
          border-bottom: none;
        }
        .el-menu-item:not(.is-disabled):focus {
          // background-color: none !important;
          // color: none !important;
          border-bottom-color: none;
        }
      }
    }
  }

  .el-main {
    width: 100%;
    height: auto;
    overflow: hidden !important;

  }
  .active {
    background-color: #2C2C34 !important;
    color: #fff !important;
  }
}

</style>
